package demo1109.demo05;

import java.util.ArrayList;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/9 17:06
 */
public class AAAPublic implements Ipublic{

    private String msg;

    private ArrayList<UserInterface> list=new ArrayList<UserInterface>();


    public void guanzhu(UserInterface userInterface) {
        list.add(userInterface);
    }

    public void quguan(UserInterface userInterface) {
        list.remove(userInterface);
    }

    public void setMsg(String msg) {
        this.msg=msg;
    }

    public void qunfa() {
        for (UserInterface userInterface:list){
            userInterface.getMsg(msg);
        }
    }
}
